
import React, { useEffect, useState } from 'react'
const CssEdit = React.lazy(() => import('./CssEidt'))
/**
 * @description 加一层懒加载
 * @param {*} props 
 * @returns 
 */
function CssEidtLazyWrapper(props) {
  let { open } = props
  const [isLazy, setIsLazy] = useState(false)

  useEffect(() => {
    if (open && !isLazy) {
      setIsLazy(true)
    }
  }, [open])

  return (

    isLazy &&
    <React.Suspense fallback=''>
      <CssEdit {...props} />
    </React.Suspense>

  )
}

export default CssEidtLazyWrapper